import {BaseEntity, Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, RelationId} from 'typeorm';

@Entity('fa_cms_archives', {schema: 'fastadmin' } )
@Index('status', ['channel_id', 'status' ])
@Index('channel', ['channel_id', 'weigh', 'id'])
export class fa_cms_archives {

    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'id',
        })
    id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'user_id',
        })
    user_id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'channel_id',
        })
    channel_id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'model_id',
        })
    model_id: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'special_id',
        })
    special_id: number;

    @Column('varchar', {
        nullable: false,
        length: 80,
        name: 'title',
        })
    title: string;

    @Column('varchar', {
        nullable: true,
        length: 100,
        name: 'style',
        })
    style: string | null;

    @Column('enum', {
        nullable: false,
        name: 'flag',
        })
    flag: string;

    @Column('varchar', {
        nullable: false,
        name: 'image',
        })
    image: string;

    @Column('varchar', {
        nullable: false,
        name: 'keywords',
        })
    keywords: string;

    @Column('varchar', {
        nullable: false,
        name: 'description',
        })
    description: string;

    @Column('varchar', {
        nullable: false,
        name: 'tags',
        })
    tags: string;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'weigh',
        })
    weigh: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'views',
        })
    views: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'comments',
        })
    comments: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'likes',
        })
    likes: number;

    @Column('int', {
        nullable: false,
        default: () => '\'0\'',
        name: 'dislikes',
        })
    dislikes: number;

    @Column('varchar', {
        nullable: false,
        length: 50,
        name: 'diyname',
        })
    diyname: string;

    @Column('int', {
        nullable: true,
        name: 'createtime',
        })
    createtime: number | null;

    @Column('int', {
        nullable: true,
        name: 'updatetime',
        })
    updatetime: number | null;

    @Column('int', {
        nullable: true,
        name: 'publishtime',
        })
    publishtime: number | null;

    @Column('int', {
        nullable: true,
        name: 'deletetime',
        })
    deletetime: number | null;

    @Column('varchar', {
        nullable: true,
        length: 100,
        name: 'memo',
        })
    memo: string | null;

    @Column('enum', {
        nullable: false,
        default: () => '\'normal\'',
        enum: ['normal', 'hidden', 'rejected', 'pulloff'],
        name: 'status',
        })
    status: string;

}
